package com.example.designpatterns.factory.factoryMethod;



public class LDOrderPizza extends OrderPizza{

    @Override
    Pizza createPizza(String orderType) {
       Pizza pizza = null;
        System.out.println("使用简单工厂模式2");
        if (orderType.equals("greek")) {
            pizza = new LDGreekPizza();
            pizza.setName(" 希腊披萨 ");
        }else if (orderType.equals("pepper")) {
            pizza = new LDPepperPizza();
            pizza.setName("胡椒披萨");
        }
        return pizza;

    }



}
